<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,user-scalable=no,target-densitydpi=300">
<title>智能云管家</title>
<link rel="shortcut icon" href="res/img/logo.png">
<link href="res/img/logo.png" rel="apple-touch-icon-precomposed">

<link rel="stylesheet" type="text/css" href="res/common.css">
<link rel="stylesheet" type="text/css" href="res/index/css/initbar.css">
<script src="../resources/js/jquery-1.7.2.min.js"></script>


<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F883c1dc0c5cf74748ff6876f4606832f' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
function getQueryParameter(qs)  
{  
	var s = location.href;  
	s = s.replace("?","?&").split("&");//这样可以保证第一个参数也能分出来 
	var re = "";  
	for(i=1;i<s.length;i++)  
		if(s[i].indexOf(qs+"=")==0)  
			re = s[i].replace(qs+"=","");//取代前面的参数名，只剩下参数值  
			  
	return re;  
}  

function detectDeviceType(){
	var isIphone =navigator.userAgent.indexOf("iPhone") != -1;
	var isIpod = navigator.userAgent.indexOf("iPod") != -1 ;
	var isIpad = navigator.userAgent.indexOf("iPad") != -1 ;
	
	var isAndroid = navigator.userAgent.indexOf("Android") != -1 ;
	var isIos = isIphone || isIpod || isIpad ;
	return isIos?"Apple":"Android";
	//return "Apple";
} 

var cc=0;
var jsonserver="http://bj.911860.com/mobile-html5-rest/";
var temp_items=[];
$(function(){
	
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	addEventListener("orientationchange", function() { 
		setTimeout(hideURLbar, 0);
		
	 }, false);
	
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
    $(window).scroll(function(){
    $("#footer").offset({top:$(document).scrollTop()+top});
    });
        }

       }); 
	   var bi_phone=localStorage.getItem("curphone");
	var bi_key=localStorage.getItem("userkey");
 $(document).ready(function(e) {
	$("#header div").click(function(){
			//window.location.href="../bilogin.html?flag=0";
			window.location.href="prodata.html"
		});
	
	//alert(bi_key);
	var selectFlag=setInterval(function(){
		var jsu=jsonserver+"bl/selectFlag/"+bi_phone;
		$.getJSON(jsu+".jsonp?callback=?",{},function(data){
			if(data=="0"){
				clearInterval(selectFlag);
				var jsonurl=jsonserver+"bl/autoLogin/"+bi_phone+"/"+bi_key;
				$.getJSON(jsonurl+".jsonp?callback=?",{},function(data){
					if(data.sb.status=="00000"){
						localStorage.setItem("userkey",bi_key);
						localStorage.setItem("curphone",bi_phone);
						localStorage.setItem("username",data.userName);
						localStorage.setItem("innetTime",data.inNetTime);
						localStorage.setItem("payType",data.payType);//0后付费
						localStorage.setItem("credit",data.credit);
						localStorage.setItem("packname",data.packageName);
						localStorage.setItem("datasDate",data.acctDay);
						window.location.href="index.html";
					}
				});
			}
		});
	},2000);

	 if(detectDeviceType()=='Apple'){
		$("#viewport").attr("content","width=640,initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5,user-scalable=no");

		if(window.localStorage.getItem(window.localStorage.getItem("curphone"))=="1"){
			$("#floatbottom").show();
			$("#floatbottom").animate({"bottom":"15px"});
			window.localStorage.setItem(window.localStorage.getItem("curphone"),"n");

		}
	}

	
	var weaurl = jsonserver+"wea/101010100";
	$.getJSON(weaurl+".jsonp?callback=?",{},function(data){
		$("#weather1").append('<img src="'+data.weaImg+'"/>');
		$("#weather2").append(data.weaDesc+data.wendu);
	});

	
	var u3=jsonserver+"ra/rec/userphone/"+bi_phone+"/ostype/"+detectDeviceType()+"/cp/1/limit/10";
	$.getJSON(u3+".jsonp?callback=?",{},function(data){
		$.each(data,function(i,items){
			var appdiv=$("<div>").addClass("reclist").click(function(){
					window.location.href=items.link;
				});
			$(items.appText).appendTo(appdiv);
			appdiv.appendTo($("#content"));
		});
	overhidden();
	});
	$("body").bind("resize",function(){
		overhidden();
	});
	var centerdiv=$("<div>").html("<span style='color:#49494b;'>进入掌沃北京</span><img src='res/index/images/wob.png' style='padding-top:15px;'/>").bind("click",function(){
		window.location.href='http://bj.wo.com.cn/smart/page/?phonenum='+curphone+'&userkey='+userkey;
		});
	var woDiv=$("<div>").addClass("woDiv1");
	$("body").append('<div class="woDiv" onclick="download()"><span style="color:#49494b;">下载智能云管家客户端</span><img src="res/img/downll.png" style="padding-top:15px;"/></div>');
	centerdiv.appendTo(woDiv);	
	var wDiv=$("<div>").css("text-align","center").css("margin-top","10px").html('<span style="color:#676767; font-size:24px;">注:本页数据仅供参考，详细内容请以营业厅信息为准!</span>');
	
	wDiv.insertAfter($("#content"));
	woDiv.insertAfter($("body"));
});

function overhidden(){
	var w=document.body.clientWidth;
	$(".apptitle").width(0.4*w+"px");
	$(".apptypefee").width("120px");
}

function tipdown(){
	$("#floatbottom").hide();
}

//window.onresize=createkedu;
</script>

<style type="text/css">
.reclist
{
	width:100%;
	height:98px;
	background-image:url(res/index/images/yingyong_bg.png)
}
*{
	font-family:Heiti SC;
	font-weight:600;
}

</style>


</head>
<link rel="icon" href="res/img/logo.png" type="image/x-icon">
<link rel="shortcut icon" href="res/img/logo.png" type="image/x-icon"> 
<body style="margin:0;">

	<div id="header">
<table width="100%" height="100%">
   	  <tr>
       	  <td width="10%">
            <div id="weather1" style="font-size:24px"></div>
          </td>
          <td width="10%">
            <marquee id="weather2" style="font-size:24px"></marquee>
          </td>
          <td width="60%" >
            <span id="packname" style="font-size:34px; font-weight:bold; color:#fff;">套餐加载中...</span>
          </td>
          <td width="20%">
	
          </td>
      </tr>
    </table>
	</div>
    <div id="content">
<div onClick="window.location.href='activity.html'"><img width="100%" src="res/img/adtivity/bar.jpg"/></div>
<div style="background:url(res/img/procing.png) repeat-x; width:100%; height:128px; line-height:60px;">
	<table width="100%">
    	<tr>
        	<td rowspan="2" align="right" width="15%"><img src="res/loading.gif"/></td>
            <td ><div style="font-size:24px; color:#426186; text-align:center;">业务信息加载中...</div></td>
        </tr>
        <tr>
        	<td > <div style="font-size:22px; color:#426186; text-align:center;">过程可能会持续几分钟,您可以访问其他内容~</div></td>
        </tr>
    </table>
    
   
</div>

<div id="floatbottom" style="position:fixed; display:none; bottom:-140px; left:19%; height:173px; line-height:86px; width:60%;; border-left:#ccc 2px solid; border-right:#ccc 2px solid; border-radius:10px; font-size:24px; background:url(res/img/todeskback.png); padding-left:10px;" onclick="tipdown()">
	<table border="0" width="100%" style="background:url(res/img/deskexit.png) no-repeat; opacity:1.0; background-position:98% 0px; margin-top:10px;">
    	<tr>
        	<td align="center"><img src="res/img/floatLogo.png" style="margin-top:5px"/></td>
            <td><span style="font-size:28px;">先点击</span><img src="res/img/temp_log.png"/><br><br><span style="font-size:30px;">再"添加到主屏幕"</span></td>
        </tr>
    </table>
<img src="res/img/desksanjiao.png" style="position:relative; top:-13px; left:46%;"/>
</div>
	</div>
<div id="footer">
</div>
    
</body>
</html>
